import {JwtHelperService} from '@auth0/angular-jwt';

export class GnOAuthUtils {
  private helper = new JwtHelperService();

  public setToken(token: string): void {
    return sessionStorage.setItem('Authorization', token);
  }

  public getToken(): string {
    return sessionStorage.getItem('Authorization');
  }

  public parseToken(token: string): any {
    return this.helper.decodeToken(token);
  }

  public tokenExpired(token: string): boolean {
    return this.helper.isTokenExpired(token);
  }
}
